//
//  PlasmacoreAppDelegate.m
//  Plasmacore
//
//  Created by Abe Pralle on 6/22/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "PlasmacoreAppDelegate.h"

@implementation PlasmacoreAppDelegate

@synthesize window;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
  NSRect mainDisplayRect = [[NSScreen mainScreen] frame];
  NSWindow *fullScreenWindow = [[NSWindow alloc] initWithContentRect: mainDisplayRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];

  [fullScreenWindow setLevel:NSMainMenuWindowLevel+1];

  [fullScreenWindow setOpaque:YES];
  [fullScreenWindow setHidesOnDeactivate:YES];

  NSOpenGLPixelFormatAttribute attrs[] =
  {
      NSOpenGLPFADoubleBuffer,
      0
  };
  NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
   
  NSRect viewRect = NSMakeRect(0.0, 0.0, mainDisplayRect.size.width, mainDisplayRect.size.height);
  NSOpenGLView *fullScreenView = [[NSOpenGLView alloc] initWithFrame:viewRect pixelFormat: pixelFormat];
  [fullScreenWindow setContentView: fullScreenView];

  [fullScreenWindow makeKeyAndOrderFront:self];
}

@end
